home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 3
/
DOS064.dsk
/
LOAN BALANCE.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
1KB
|
35 lines
10 PRINT "REMAINING BALANCE ON A LOAN"
20 PRINT
29 REM - STATEMENTS 30 TO 130 REQUEST USER INPUT
30 PRINT "REGULAR PAYMENT";
40 INPUT R
50 PRINT "PRINCIPAL";
60 INPUT P
70 PRINT "NUMBER OF PAYMENTS PER YEAR";
80 INPUT N
90 PRINT "ANNUAL INTEREST RATE";
100 INPUT I
109 REM - CONVERT FROM PERCENT TO DECIMAL
110 I = I/100
119 REM - ENTER THE PAYMENT NUMBER WITHIN THE YEAR, I.E. N1<=N
120 PRINT "LAST PAYMENT MADE ( PAYMENT N0. , YEAR )";
130 INPUT N1,Y
139 REM - INITIALIZE REMAINING BALANCE
140 B0 = P
149 REM - LOOP TO ACCUMULATE AMOUNT PAID SO FAR
150 FOR J1 = 1 TO N *(Y -1) +N1
159 REM - CALCULATE INTEREST PAID WITH EACH PAYMENT
160 I1 = INT((B0 *I/N) *100 +.5)/100
169 REM - CALCULATE AMOUNT AMORTIZED WITH EACH PAYMENT
170 A = R -I1
179 REM - CALCULATE REMAINING BALANCE ON PRINCIPAL
180 B0 = B0 -A
190 NEXT J1
199 REM ROUND OFF, PRINT
200 PRINT "REMAINING BALANCE = $"; INT(B0 *100 +.5)/100
210 PRINT
219 REM - RESTART OR END PROGRAM
220 PRINT "MORE DATA? (1=YES, 0=NO)";
230 INPUT X
240 IF X = 1 THEN 20
250 PRINT "<CTRL-D>RUN HELLO"